Meridian Design Doc Prep Call

2023-06-23 MERidian Design Doc Prep Call

Agenda

  • Interfaces between components
    • Saturn log
    • Station log
    • payment contract input
    • evaluation contract input
  • Hypercerts?
  • Scale of Station modules

Sync Notes

REWARD - How to scale this beyond 100k recipients

  • If we are expecting 100k nodes, then it is going to be difficult to pay people at this scale.
  • For Saturn we are having to batch deploy the payouts. Takes around a minute to get back a receipt. Big concerns around how to automate this?
    • What are the memory limits of a smart contract?
    • Can we look into L2 solutions like IPC?
  • Could we do a closed beta to avoid scalability problems?
  • Is the scalability problem something that the IPC team can fix? Or some other FIL/FVM team?
  • Possible generalization: Saturn implementation is quite modular, each of the constraints could be a reusable payments building block
  • Similar to map reduce frameworks
  • Can we use the Saturn setup but reward based on different fields?

Saturn Log

"public"."bandwidth_logs" (
    "node_id" uuid NOT NULL,
    "client_id" uuid NULL,
    "request_id" character varying NULL,
    "cid" character varying NOT NULL,
    "num_bytes_sent" bigint NOT NULL,
    "request_byte_offset" bigint NOT NULL DEFAULT 0,
    "start_time" timestamptz NOT NULL,
    "request_duration_sec" numeric NOT NULL,
    "cache_hit" boolean NOT NULL DEFAULT FALSE,
    "user_agent" text NULL,
    "client_address" inet NULL,
    "referrer" text NULL,
    "file_path" text NULL,
    "http_status_code" smallint NULL,
    "http_protocol" character varying NULL,
    "log_sender" character varying NULL,
    "if_network_error" character varying NULL,
    "ttfb_ms" integer NULL,
    "http_host" character varying NULL,
    "url" character varying NULL,
    "path_prefix" character varying NULL,
    "request_role" character varying NULL,
    "verification_error" character varying NULL,
    "node_ip_address" inet NULL,
    "format" character varying NULL
)
{
    "node_id": "e69c231c-4f72-40ad-827d-f5f67929ab4e",
    "client_id": "f6fe1a99-0f3e-4f14-b1ea-a0ab3db73a31",
    "request_id": "99396a5b047e42419e2c3a327f62a78b",
    "cid": "bafkreidksdimstv5qslhtudy57njitolluhcwbiqaxg4bacyg5kwla4pba",
    "num_bytes_sent": 1490,
    "request_byte_offset": 0,
    "start_time": "2023-05-01 00:52:57.62+00",
    "request_duration_sec": 0.444,
    "cache_hit": "True",
    "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36",
    "client_address": "70.34.216.176",
    "referrer": "https://movies4us.co/",
    "file_path": "NULL",
    "http_status_code": 200,
    "path_prefix": "ipfs",
    "http_protocol": "h2",
    "log_sender": "RC",
    "if_network_error": "NULL",
    "ttfb_ms": 276,
    "http_host": "l1s.strn.pl",
    "url": "https://l1s.strn.pl/ipfs/bafkreidksdimstv5qslhtudy57njitolluhcwbiqaxg4bacyg5kwla4pba?clientId=f6fe1a99-0f3e-4f14-b1ea-a0ab3db73a31&depth=1&format=car",
    "request_role": "client",
    "verification_error": "NULL",
    "node_ip_address": "NULL",
    "format": "car"
  }

Station Log

{
   "id":500000,
   "cid":"bafybeib2xmc63xi6sqhl7ixq6wyv5yyayawwb742z6ufwdmh5cj7k7jyya",
   "providerAddress":"/dns4/elastic.dag.house/tcp/443/wss",
   "protocol":"bitswap",
   "createdAt":"2023-06-05T14:23:05.917Z",
   "finishedAt":"2023-06-05T14:23:10.222Z",
   "success":true,
   "startAt":"2023-06-05T14:23:06.094Z",
   "statusCode":200,
   "firstByteAt":"2023-06-05T14:23:06.098Z",
   "endAt":"2023-06-05T14:23:10.069Z",
}
{
   "id":500000,
   "createdAt":"2023-06-05T14:23:05.917Z",
   "finishedAt":"2023-06-05T14:23:10.222Z",
   "success":true,
	 "fields": {
      "cid":"bafybeib2xmc63xi6sqhl7ixq6wyv5yyayawwb742z6ufwdmh5cj7k7jyya",
      "providerAddress":"/dns4/elastic.dag.house/tcp/443/wss",
      "protocol":"bitswap",
      "statusCode":200,
      "firstByteAt":"2023-06-05T14:23:06.098Z",
      "startAt":"2023-06-05T14:23:06.094Z",
      "endAt":"2023-06-05T14:23:10.069Z"
  }
}

Measure

Each Station submits a summary on chain for the epoch, or the Saturn orchestrator submits all of these and Saturn nodes can verify that their logs made it on chain.

{
   "node_id": "1",
    "epoch": "3",
   "total_contribution": "4000"
   "merkle_root_or_kzg_commitment_of_jobs": "<hash>"
}

{
   "node_id": "2",
    "epoch": "3",
   "total_contribution": "6000"
   "merkle_root_or_kzg_commitment_of_jobs": "<hash>"
}

Evaluation

{
  "epoch": "3",
  "payees": [{
    "node_id": "1",
    "proportion": "0.4",
  },{
    "node_id": "2",
    "proportion": "0.6",
  }],
}

Payout

{
    "evaluation_cid": "Qm..."
    "fil_for_epoch": "2000"
}

Action Items

  • Patrick to reach out to Marko about using IPC subnets for scalability
  • Amean to reach out to CryptNet and FVM about scalability solutions